/*
 * Report.java
 */

package org.owasp.scrubbr.db.report;

import org.owasp.scrubbr.db.Table;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;

public class Report {
    
    /** Creates a new instance of Report */
    
    private Date start;
    private Date end;
 
    private long rowsScanned = 0;
    private int tablesScanned = 0;
    private long taintedRows = 0;
    private long taintedTuples = 0;
    
    public long getRowsScanned() {
        return rowsScanned;
    }
    
    public long getTaintedRows() {
        return taintedRows;
    }
    
    public long getTaintedTuples() {
        return taintedTuples;
    }
    
    public int getNumberOfTablesScanned() {
        return tablesScanned;
    }
    
    private ArrayList<Table> tables = new ArrayList<Table>();
    
    public List<Table> getScannedTables() {
        return tables;
    }
    
    public Report() {
        this.start = new Date(); 
    }
 
    public void endScan() {
        end = new Date();
    }
    
    public long getScanTime() {
        return (end.getTime()-start.getTime()) / 1000;
    }
    
    public void addScannedTable (Table table) {
        taintedTuples += table.getTaintedTuples();
        taintedRows += table.getTaintedRows().size();
        rowsScanned += table.getRowCount();
        tables.add(table);
        tablesScanned++;
    }
    
    public void incrementTablesScanned() {
        tablesScanned++;
    }
    
}
